Ext.onReady(function(){

	new Ext.Button({
		renderTo: 'test',
		id: 'b2',
		text: 'for get'
	});
	
	Ext.get('b2').on('click',function() {
	    Ext.Ajax.request({
	        url: 'user2.do?action=get&ajax=get',
	        callback: function(options, success, response) {
//	            alert(success + ',' + Ext.util.JSON.encode(Ext.util.JSON.decode(response.responseText)));
	        	alert(success + ',' + response.responseText);
	        },
	        params: {
	            node: 'C',
	            name: 'ABC'
	        }
	    });
	});
	
	////// paging grid
	var myData = [
    ];

    // create the data store
    var store = new Ext.data.Store({
    	url: 'paging.do?action=query',
    	reader: new Ext.data.JsonReader({
    		root: 'content',
    		totalProperty: 'totalCount',
    		id: 'id',
    		fields: [
	           {name: 'id'},
	           {name: 'name'}
	        ]
    	})
        
    });
    
	var grid = new Ext.grid.GridPanel({
    	renderTo: 'grid',
        store: store,
        columns: [
            {header: "id", width: 75, dataIndex: 'id'},
            {header: "name", width: 75, dataIndex: 'name'}
        ],
        width: 480,
        height: 400,
        stripeRows: true,
        title: 'Grid',
        bbar: new Ext.PagingToolbar({
            pageSize: 1,
            store: store,
            displayInfo: true,
            displayMsg: 'Displaying topics {0} - {1} of {2}',
            emptyMsg: "No topics to display",
            paramNames: {start: 'start', limit: 'limit', total: 'total'}
        }),
        listeners: {
        	'rowclick': function(grid, rowIndex, e) {
        		//alert('you click ' + rowIndex);
        	}
        }
    });
    store.load({params:{start:0, limit:1}});
});